package homework.day05;

/**
 * @author ThinkBook
 */
public class Test08 {
    public static void main(String[] args) {
        Person p1 = new Person("jack",21);
        p1.show();
        System.out.println("--------------");
        Person p2 = new Person("lucy");
        p2.show();
    }
}
class Person {
    private String name;
    private int age;

    //补全代码
    public Person() {

    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person(String name) {
        //定义一参构造器，参数为name，要求该构造器借助借助两参构造器实现功能
        this(name,10);
    }

    public void show() {
        System.out.println("名字是" + name);
        System.out.println("年龄是" + age);
    }
}

